package com.example.demo.repository;

import com.example.demo.dataobject.BloodSugar;
import com.example.demo.dataobject.BloodSugarRecord;
import org.springframework.data.jpa.repository.JpaRepository;

import java.sql.Date;
import java.util.List;

public interface BloodSugarRecordRepository extends JpaRepository<BloodSugarRecord,Integer> {
//    List<BloodSugarRecord> findByTelephoneOrderByRecordTimeDesc(String telephone);
    List<BloodSugarRecord> findByUserIdOrderByRecordTimeDesc(Integer userId);
//    List<BloodSugarRecord> findByTelephoneOrderByRecordTimeDescLi
    BloodSugarRecord findById(Integer id);
    List<BloodSugarRecord> findByDateOrderByRecordTime(Date date);
//    List<BloodSugarRecord> findByTelephoneAndDateOrderByRecordTime(String telephone,Date date);
    List<BloodSugarRecord> findByUserIdAndDateOrderByRecordTime(Integer userId,Date date);


    List<BloodSugarRecord> findByUserIdAndDateAfter(Integer userId,Date date);

//    List<BloodSugarRecord> findByUserIdAAndDate(Integer userId,Date date);

}
